import request from '@/utils/request';

/**
 * 获取用户列表
 * @param {*} data 
 */
export function getUserList(data) {
  return request.post('/sysUser/queryList', data)
}

/**
 * 获取用户详情
 * @param {*} data 
 */
export function getUserInfo(data) {
  return request.get('/sysUser/getSysUser', {
    params: data
  })
}

/**
 * 获取角色
 * @param {*} data 
 */
export function getRulesList(data) {
  return request.post('/sysRole/queryList',data)
}

/**
 * 获取树形菜单
 */
export function getTreeMenu() {
  return request.get('/public/tMenu/tree')
}

/**
 * 新增
 * @param {*} data 
 */
export function addUser(data) {
  return request.post('/sysUser/createSysUser', data)
} 

/**
 * 修改用户信息
 * @param {*} data 
 */
export function updateUser(data) {
  return request.post('/sysUser/updateSysUser', data)
}

/**
 * 删除用户
 * @param {*} data 
 */
export function deleteUser(data) {
  return request.get('/sysUser/deleteSysUser' ,{
    params: data
  })
}

/**
 * 重置用户密码
 * @param {重} data 
 */
export function restUserPass(data) {
  return request.get('/sysUser/resetPassword', {
    params:data
  })
}

/**
 * 批量删除
 * @param {*} data 
 */
export function batchDeleteUser(data) {
  return request.post('/sysUser/batchDeleteSysUser', data)
}

/**
 * 批量启用
 * @param {*} data 
 */
export function batchEnableUser(data) {
  return request.post('/sysUser/batchEnable', data)
}

/**
 * 批量停用
 * @param {*} data 
 */
export function batchDisableUser(data) {
  return request.post('/sysUser/batchDisable', data)
}